<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 400px;
            background-color: pink;
        }

        .inner {
            width: 200px;
            height: 200px;
            background-color: green;
        }
    </style>
</head>

<body>
    <div class="box" onclick="say()">
        <div class="inner" onclick="cry()">

        </div>
    </div>
    <script>
        
        var boxEl = document.querySelector('.box');
        var innerEl = document.querySelector('.inner');  // 会优先执行addEventListener的函数

        boxEl.addEventListener('click', run,true) 
        innerEl.addEventListener('click',tiao,true)

        function say() {
            console.log('haha');
        }
        function cry() {
            console.log('wuwu');
        }

        function run(){
            console.log('paopao');
        }
        function tiao() {
            console.log('haiya');
        }
    </script>
</body>

</html>